var Page_Home = {};

<?php
	render('/Javascript/Snippet.Url.js');
?>

$(document).ready
(
	function() 
	{
		$('#post').click(function(){
			$('#post_form').submit();
		});

		$('#update_status').click(function(){
			updateStatus();
		});

		$('#user_logout').click(function(){
			userLogout();
		});

		//timeline();
	}
)


function updateStatus() {
	
	var accountId = $('#accountId').val();
	var accountReference = $('#accountReference').val();

	Common.Api.callJson
	(
		null,
		'Account',
		'updateStatus',
		{
			accountId: accountId,
			accountReference: accountReference
		},
		function(result) {
			window.location.reload()
		}
	);
}


function userLogout(){

	Common.Api.callJson
	(
		null,
		'Account',
		'userLogout',
		{},
		function(result){
			console.log(result);
			alert('Bye ' + result.screen_name);
			location.href='/';
		}
	)
}